feat(codegen): deduplicate repeated legal comments#11069
feat(codegen): deduplicate repeated legal comments#11069graphite-app[bot] merged 1 commit intomainfrom
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
There was a problem hiding this comment.
Pull Request Overview
This PR deduplicates repeated legal comments to streamline the output and improve code efficiency.
- Removed duplicate legal comment lines in test snapshots.
- Refactored legal comment handling in the Codegen module by removing the persistent legal_comments field and implementing a function to deduplicate and return legal comments.
- Updated the comment processing logic to use a hash set for deduplication.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| crates/oxc_codegen/tests/integration/snapshots/legal_linked_comments.snap | Removed duplicate legal comment lines. |
| crates/oxc_codegen/tests/integration/snapshots/legal_eof_minify_comments.snap | Removed duplicate legal comment lines. |
| crates/oxc_codegen/tests/integration/snapshots/legal_eof_comments.snap | Removed duplicate legal comment lines. |
| crates/oxc_codegen/src/lib.rs | Removed the legal_comments field and updated CodegenReturn to use deduplicated legal comments. |
| crates/oxc_codegen/src/comment.rs | Replaced try_print_eof_legal_comments with handle_eof_linked_or_external_comments that deduplicates legal comments. |
Comments suppressed due to low confidence (1)
crates/oxc_codegen/src/lib.rs:199
- Ensure that the removal of the persistent legal_comments field and the shift to a function-based approach does not inadvertently affect other parts of the codebase that might have relied on side effects from the previous implementation.
let legal_comments = self.handle_eof_linked_or_external_comments(program);
CodSpeed Instrumentation Performance ReportMerging #11069 will not alter performanceComparing Summary
|
Merge activity
|
325345d to
c29b1b8
Compare

related: evanw/esbuild@a54916b
closes #10688